package li.kaeppe.travel.tracker.service;

import java.util.UUID;

import li.kaeppe.travel.tracker.domain.Trip;

public class UuidTripIdCreatorImpl implements TripIdCreator {

	/**  
	 * This method creates a unique identifier for a Trip based
	 * on attributes of the trip and the time stamp of the creation
	 * of the UUID.
	 * This method creates different UUIDs eventhough the same trip
	 * is given as parameter!
	 * @param trip 
	 * @return unique identifier 
	 */
	public String generateTripId(Trip trip) {
		return Integer.toString(Math.abs(UUID.randomUUID().toString().hashCode()));
	}

}
